<fieldset>
    <legend>Danh sách danh mục</legend>
    <br />
    <input type="button" value="Thêm danh mục mới" onclick="window.location='<?php echo Utility::getSiteUrl();?>/category/add'" style="height:30px">
    <br />
    <table border="1" style="text-align:center;">
        <thead>
        <tr>
            <th>STT</th>
            <th>Tên danh mục</th>
            <th colspan="2">Thao tác </th>
        </tr>
        </thead>
        <tbody>
            <?php
                if(isset($cat_list))
                {
                    $size = count($cat_list);
                    if($size == 0)
                    {
                        ?>
                <tr>
                    <td colspan="4" style="color:red;font-weight:bold;">Chưa có danh mục nào</td>
                </tr>
                        <?php
                    }
                    else
                    {
                        $i = 1;
                        foreach($cat_list as $cat)
                        {
                            ?>
                <tr>
                    <td><?php echo $i; ?></td>
                    <td style="text-align:left;padding-left:5px"><?php for($j = 0;$j < $cat->c_level;$j++) echo " - - ";echo $cat->name ?></td>
                    <td><input type="button" onclick="window.location='<?php echo Utility::getSiteUrl() . "/category/edit/" . $cat->id;?>'" value="Sửa"/></td>
                    <td><input type="button" onclick="window.location='<?php echo Utility::getSiteUrl() . "/category/remove/"
                        . $cat->id;?>'" value="Xóa"/></td>
                </tr>
                            <?php
                            $i++;
                        }
                    }
                }
             ?>
        </tbody>
    </table>
</fieldset>